﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace iCollect.Chart
{
    public partial class FastLineChartWithoutMargin : UserControl
    {
        public FastLineChartWithoutMargin()
        {
            InitializeComponent();

            this.Load += new System.EventHandler(this.PieChartType_Load);
        }

        private void PieChartType_Load(object sender, System.EventArgs e)
        {
            AddPoints(500);
            //UpdateChartSettings();
        }

        private void AddPoints(int pointCount)
        {
            // Fill series data
            double yValue = 50.0;
           // double yValue2 = 200.0;
            if (chart1.Series["Series1"].Points.Count > 0)
            {
                yValue = chart1.Series["Series1"].Points[chart1.Series["Series1"].Points.Count - 1].YValues[0];
                //yValue2 = chart1.Series["Series2"].Points[chart1.Series["Series1"].Points.Count - 1].YValues[0];
            }
            Random random = new Random();
            for (int pointIndex = 0; pointIndex < pointCount; pointIndex++)
            {
                yValue = (float)(random.NextDouble() * 100.0 - 5.0);
                chart1.Series["Series1"].Points.AddY(yValue);

                //yValue2 = yValue2 + (float)(random.NextDouble() * 100.0 - 5.0);
                //chart1.Series["Series2"].Points.AddY(yValue2);
            }
        }

        


    }
}
